// 分发actions，页面的action同意dispatch到此进行逻辑处理
import * as types from './mutation-types.js'

// 首页各个模块跳转
export const changePage = ({ commit }, payload) => {
  commit(types.CHANGE_PAGE, {
    titleIndex: payload.title
  })
}

// 点击列表项进入详情页面
export const goDetailPage = ({ commit }, payload) => {
  if (payload.id) {
    commit(types.GO_DETAIL_PAGES, {
      id: payload.id
    })
  }
}
//展示或者隐藏底部tabbar
export const showTabbar = ({ commit }, payload) => {
  commit(types.TABBAR_SHOW, {
    tabbarshowIndex: payload.boolean
  })
}

//展示或者顶部 back icon
export const showBackIcon = ({ commit }, payload) => {
  commit(types.BACKICON_SHOW, {
    backIconshowIndex: payload.boolean
  })
}